package com.ruoyi.coffeemenu.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.coffeemenu.mapper.CoffeemenuMapper;
import com.ruoyi.coffeemenu.domain.Coffeemenu;
import com.ruoyi.coffeemenu.service.ICoffeemenuService;

/**
 * 咖啡菜单Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-10-28
 */
@Service
public class CoffeemenuServiceImpl implements ICoffeemenuService 
{
    @Autowired
    private CoffeemenuMapper coffeemenuMapper;

    /**
     * 查询咖啡菜单
     * 
     * @param productId 咖啡菜单主键
     * @return 咖啡菜单
     */
    @Override
    public Coffeemenu selectCoffeemenuByProductId(Long productId)
    {
        return coffeemenuMapper.selectCoffeemenuByProductId(productId);
    }

    /**
     * 查询咖啡菜单列表
     * 
     * @param coffeemenu 咖啡菜单
     * @return 咖啡菜单
     */
    @Override
    public List<Coffeemenu> selectCoffeemenuList(Coffeemenu coffeemenu)
    {
        return coffeemenuMapper.selectCoffeemenuList(coffeemenu);
    }

    /**
     * 新增咖啡菜单
     * 
     * @param coffeemenu 咖啡菜单
     * @return 结果
     */
    @Override
    public int insertCoffeemenu(Coffeemenu coffeemenu)
    {
        return coffeemenuMapper.insertCoffeemenu(coffeemenu);
    }

    /**
     * 修改咖啡菜单
     * 
     * @param coffeemenu 咖啡菜单
     * @return 结果
     */
    @Override
    public int updateCoffeemenu(Coffeemenu coffeemenu)
    {
        return coffeemenuMapper.updateCoffeemenu(coffeemenu);
    }

    /**
     * 批量删除咖啡菜单
     * 
     * @param productIds 需要删除的咖啡菜单主键
     * @return 结果
     */
    @Override
    public int deleteCoffeemenuByProductIds(Long[] productIds)
    {
        return coffeemenuMapper.deleteCoffeemenuByProductIds(productIds);
    }

    /**
     * 删除咖啡菜单信息
     * 
     * @param productId 咖啡菜单主键
     * @return 结果
     */
    @Override
    public int deleteCoffeemenuByProductId(Long productId)
    {
        return coffeemenuMapper.deleteCoffeemenuByProductId(productId);
    }
}
